<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:oasis:names:tc:emergency:EDXL:DE:1.0" targetNamespace="urn:oasis:names:tc:emergency:EDXL:DE:1.0" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
  
	<xsd:element name="EDXLDistribution">
    		<xsd:complexType>
      		<xsd:sequence>
        			<xsd:element name="distributionID" type="xsd:string"/>
        			<xsd:element name="senderID" type="xsd:string"/>
        			<xsd:element name="dateTimeSent" type="xsd:dateTime"/>
        			<xsd:element name="distributionStatus" type="statusValues"/>
        			<xsd:element name="distributionType" type="typeValues"/>
        			<xsd:element name="combinedConfidentiality" type="xsd:string"/>
        			<xsd:element name="language" type="xsd:string" minOccurs="0"/>
                		<xsd:element name="senderRole" type="valueListType" minOccurs="0" maxOccurs="unbounded"/>
                		<xsd:element name="recipientRole" type="valueListType" minOccurs="0" maxOccurs="unbounded"/>
        			<xsd:element name="keyword" type="valueListType" minOccurs="0" maxOccurs="unbounded"/>
                		<xsd:element name="distributionReference" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
        			<xsd:element name="explicitAddress" type="valueSchemeType" minOccurs="0" maxOccurs="unbounded"/>
        			<xsd:element name="targetArea" type="targetAreaType" minOccurs="0" maxOccurs="unbounded"/>
        			<xsd:element name="contentObject" type="contentObjectType" minOccurs="0" maxOccurs="unbounded"/>
      		</xsd:sequence>
    		</xsd:complexType>
  	</xsd:element>
	<xsd:annotation/>
	<xsd:annotation/>

  	<xsd:complexType name="contentObjectType">
    		<xsd:sequence>
      		<xsd:element name="contentDescription" type="xsd:string" minOccurs="0"/>
     			<xsd:element name="contentKeyword" type="valueListType" minOccurs="0" maxOccurs="unbounded"/>
       		<xsd:element name="incidentID" type="xsd:string" minOccurs="0"/>
        		<xsd:element name="incidentDescription" type="xsd:string" minOccurs="0"/>
      		<xsd:element name="originatorRole" type="valueListType" minOccurs="0" maxOccurs="unbounded"/>
      		<xsd:element name="consumerRole" type="valueListType" minOccurs="0" maxOccurs="unbounded"/>
      		<xsd:element name="confidentiality" type="xsd:string" minOccurs="0"/>
       		
      		<xsd:choice>
        			<xsd:element name="nonXMLContent" type="nonXMLContentType"/>
        			<xsd:element name="xmlContent" type="xmlContentType"/>
      		</xsd:choice>

			<xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />

    		</xsd:sequence>
  	</xsd:complexType>
  	
   	<xsd:complexType name="nonXMLContentType">
    		<xsd:sequence>
      		<xsd:element name="mimeType" type="xsd:string"/>
      		<xsd:element name="size" type="xsd:integer" minOccurs="0"/>
      		<xsd:element name="digest" type="xsd:string" minOccurs="0"/>
      		<xsd:element name="uri" type="xsd:anyURI" minOccurs="0"/>
      		<xsd:element name="contentData" type="xsd:base64Binary" minOccurs="0"/>
    		</xsd:sequence>
  	</xsd:complexType>
  	
	<xsd:complexType name="xmlContentType">
    		<xsd:sequence>
      		<xsd:element name="keyXMLContent" type="anyXMLType" minOccurs="0" maxOccurs="unbounded"/>
      		<xsd:element name="embeddedXMLContent" type="anyXMLType" minOccurs="0" maxOccurs="unbounded"/>
    		</xsd:sequence>
  	</xsd:complexType>
  	
  	<xsd:complexType name="anyXMLType">
    		<xsd:sequence>
      		<xsd:any namespace="##other" processContents="lax" maxOccurs="unbounded"/>
    		</xsd:sequence>

    		<xsd:anyAttribute namespace="##other" processContents="lax"/>
  	</xsd:complexType>
  	
  	<xsd:complexType name="valueListType">
    		<xsd:sequence>
      		<xsd:element name="valueListUrn" type="xsd:string" />
      		<xsd:element name="value" type="xsd:string" maxOccurs="unbounded"/>
    		</xsd:sequence>
  	</xsd:complexType>

  	<xsd:complexType name="valueSchemeType">
    		<xsd:sequence>
      		<xsd:element name="explicitAddressScheme" type="xsd:string"/>
      		<xsd:element name="explicitAddressValue" type="xsd:string" maxOccurs="unbounded"/>
    		</xsd:sequence>
  	</xsd:complexType>

  	<xsd:complexType name="targetAreaType">
    		<xsd:sequence>
      		<xsd:element name="circle" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
      		<xsd:element name="polygon" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
      		<xsd:element name="country" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
      		<xsd:element name="subdivision" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
      		<xsd:element name="locCodeUN" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
    		</xsd:sequence>
  	</xsd:complexType>
  	
  	<xsd:simpleType name="statusValues">
    		<xsd:restriction base="xsd:NMTOKEN">
      		<xsd:enumeration value="Actual"/>
      		<xsd:enumeration value="Exercise"/>
      		<xsd:enumeration value="System"/>
      		<xsd:enumeration value="Test"/>
    		</xsd:restriction>
  	</xsd:simpleType>

  	<xsd:simpleType name="typeValues">
    		<xsd:restriction base="xsd:NMTOKEN">
      		<xsd:enumeration value="Report"/>
      		<xsd:enumeration value="Update"/>
      		<xsd:enumeration value="Cancel"/>
      		<xsd:enumeration value="Request"/>
      		<xsd:enumeration value="Response"/>
      		<xsd:enumeration value="Dispatch"/>
      		<xsd:enumeration value="Ack"/>    		
      		<xsd:enumeration value="Error"/>
      		<xsd:enumeration value="SensorConfiguration"/>
      		<xsd:enumeration value="SensorControl"/>
      		<xsd:enumeration value="SensorStatus"/>
      		<xsd:enumeration value="SensorDetection"/>
    		</xsd:restriction>
  	</xsd:simpleType>
</xsd:schema>